package com.lz.manage.model.vo.folderInfo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lz.common.annotation.Excel;
import com.lz.manage.model.domain.FolderInfo;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * 文件夹信息Vo对象 t_folder_info
 *
 * @author YY
 * @date 2025-07-17
 */
@Data
public class FolderInfoVo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 文件夹编号
     */
    @Excel(name = "文件夹编号")
    private Long folderId;

    /**
     * 父级
     */
    @Excel(name = "父级")
    private String parentId;

    /**
     * 文件夹名称
     */
    @Excel(name = "文件夹名称")
    private String folderName;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    private String userName;
    private Long userId;

    /**
     * 排序权重
     */
    private Long sortNum;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updateTime;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remark;


    /**
     * 对象转封装类
     *
     * @param folderInfo FolderInfo实体对象
     * @return FolderInfoVo
     */
    public static FolderInfoVo objToVo(FolderInfo folderInfo) {
        if (folderInfo == null) {
            return null;
        }
        FolderInfoVo folderInfoVo = new FolderInfoVo();
        BeanUtils.copyProperties(folderInfo, folderInfoVo);
        return folderInfoVo;
    }
}
